<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--
  Created by IntelliJ IDEA.
  User: sunset
  Date: 2021/6/2
  Time: 11:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>客户管理</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <style>
        a {
            border-radius: 5px;
            background-color: darkgreen;
            color: white;
        }
    </style>
</head>
<body>

<div class="container">

    <div class="row-clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>客户列表</small>
                </h1>
            </div>
        </div>
    </div>

    <div class="col-md-10 column"></div>
    <a class="btn btn-primary" href="${pageContext.request.contextPath}/client/allClient">显示所有客户</a>

    <div class="row clearfix">
        <div class="col-md-8 column">
            <!--查询用户-->
            <span style="color: #ff0000 ;font-weight: bold">${error}</span>
            <form  class="form-inline" action="${pageContext.request.contextPath}/client/queryClient" method="post" style="float: left">
                <div class="form-group">

                    <input type="text" name="name" class="form-control"  placeholder="--客户名称--" required>
                </div>
                <input type="submit"  value="查询" class="btn btn-primary">I

            </form>

        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>客户编号</th>
                    <th>客户名称</th>
                    <th>电话</th>
                    <th>地址</th>
                    <th>邮箱</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                    <c:forEach var="client" items="${list}">
                        <tr>
                            <td> ${client.id}</td>
                            <td> ${client.name}</td>
                            <td> ${client.phone}</td>
                            <td> ${client.address}</td>
                            <td> ${client.email}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}/client/toUpdatePage?id=${client.id}">修改</a>
                                &nbsp;&nbsp;
                                <a href="${pageContext.request.contextPath}/client/deleteClient?id=${client.id}">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>
        </div>
        <div class="box-tools pull-right">
            <ul class="pagination">
                <li><a href="${pageContext.request.contextPath}/client/listData " aria-label="Previous">首页</a></li>
                <li><a href="${pageContext.request.contextPath}/client/listData">上一页</a></li>
                <c:forEach begin="1" end="${pageInfo.pages}" var="pageNum">
                    <li><a href="${pageContext.request.contextPath}/client/listData">${pageNum}</a></li>
                </c:forEach>
                <li><a href="${pageContext.request.contextPath}/client/listData">下一页</a></li>
                <li><a href="${pageContext.request.contextPath}/client/listData" aria-label="Next">尾页</a></li>
            </ul>
        </div>
    </div>
</div>
</body>
</html>
